jQuery().ready(function() {
	
	function formatItem(row) {
		return row[0] + " (<strong>" + row[1] + "</strong>)";
	}
	function formatResult(row) {
		return row[0].replace(/(<.+?>)/gi, '');
	}
	
	$("#part_number").autocomplete('index.php?module=reequipment&type=user&func=lookup_parts&phase=part_number&pageName=blank', {
		width: 300,
		multiple: false,
		matchContains: true,
		formatItem: formatItem,
		formatResult: formatResult
	});
	
    jQuery("#part_number").result(function(event, data, formatted) {
        jQuery("#description").val(data[1]);
        jQuery("#man_part_number").val(data[2]);
        jQuery("#cost").val(data[3]);
    });	
	
});
